package com.gitee.wsl.collections.map

import androidx.collection.IntObjectMap
import androidx.collection.MutableIntObjectMap


/**
 * Returns an empty, read-only [IntObjectMap].
 */
@Suppress("UNCHECKED_CAST")
fun<V>  Maps.emptyIntObjectMap(): IntObjectMap<V> = androidx.collection.emptyIntObjectMap()

/**
 * Returns an empty, read-only [IntObjectMap].
 */
@Suppress("UNCHECKED_CAST")
fun<V>  Maps.intObjectMapOf(): IntObjectMap<V> = androidx.collection.intObjectMapOf()

/**
 * Returns a new [IntObjectMap] with [key1] associated with [value1].
 */
fun<V>  Maps.intObjectMapOf(
    key1: Int,
    value1: V
): IntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
}

/**
 * Returns a new [IntObjectMap] with [key1], and [key2]
 * associated with [value1], and [value2], respectively.
 */
fun<V>  Maps.intObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
): IntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
}

/**
 * Returns a new [IntObjectMap] with [key1], [key2], and [key3]
 * associated with [value1], [value2], and [value3], respectively.
 */
fun<V>  Maps.intObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
): IntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
}

/**
 * Returns a new [IntObjectMap] with [key1], [key2], [key3], and [key4]
 * associated with [value1], [value2], [value3], and [value4], respectively.
 */
fun<V>  Maps.intObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
    key4: Int,
    value4: V,
): IntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
    map[key4] = value4
}

/**
 * Returns a new [IntObjectMap] with [key1], [key2], [key3], [key4], and [key5]
 * associated with [value1], [value2], [value3], [value4], and [value5], respectively.
 */
fun<V>  Maps.intObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
    key4: Int,
    value4: V,
    key5: Int,
    value5: V,
): IntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
    map[key4] = value4
    map[key5] = value5
}

/**
 * Returns a new [MutableIntObjectMap].
 */
fun<V>  Maps.mutableIntObjectMapOf(): MutableIntObjectMap<V> = MutableIntObjectMap()

/**
 * Returns a new [MutableIntObjectMap] with [key1] associated with [value1].
 */
fun<V>  Maps.mutableIntObjectMapOf(
    key1: Int,
    value1: V
): MutableIntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
}

/**
 * Returns a new [MutableIntObjectMap] with [key1], and [key2]
 * associated with [value1], and [value2], respectively.
 */
fun<V>  Maps.mutableIntObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
): MutableIntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
}

/**
 * Returns a new [MutableIntObjectMap] with [key1], [key2], and [key3]
 * associated with [value1], [value2], and [value3], respectively.
 */
fun<V>  Maps.mutableIntObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
): MutableIntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
}

/**
 * Returns a new [MutableIntObjectMap] with [key1], [key2], [key3], and [key4]
 * associated with [value1], [value2], [value3], and [value4], respectively.
 */
fun<V>  Maps.mutableIntObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
    key4: Int,
    value4: V,
): MutableIntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
    map[key4] = value4
}

/**
 * Returns a new [MutableIntObjectMap] with [key1], [key2], [key3], [key4], and [key5]
 * associated with [value1], [value2], [value3], [value4], and [value5], respectively.
 */
fun<V>  Maps.mutableIntObjectMapOf(
    key1: Int,
    value1: V,
    key2: Int,
    value2: V,
    key3: Int,
    value3: V,
    key4: Int,
    value4: V,
    key5: Int,
    value5: V,
): MutableIntObjectMap<V> = MutableIntObjectMap<V>().also { map ->
    map[key1] = value1
    map[key2] = value2
    map[key3] = value3
    map[key4] = value4
    map[key5] = value5
}
